package io.jee.caisan.weixin.service;

import io.jee.alaska.util.Result;
import io.jee.caisan.weixin.domain.Member;
import io.jee.caisan.weixin.vo.MemberVo;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

public interface MemberService {
	/**
	 * 根据mid获取用户信息
	 * 
	 * @param mid
	 * @return
	 */
	MemberVo getMember(int mid);

	/**
	 * 根据openid获取用户
	 * 
	 * @param openid
	 * @return
	 */
	Member findByOpenid(String openid);

	/**
	 * 绑定账户
	 * 
	 * @param username
	 * @param password
	 * @param openid
	 * @return
	 */
	Result<Member> binding(String username, String password, String openid);

	/**
	 * 取消绑定
	 * 
	 * @param mid
	 * @return
	 */
	Result<Void> unbind(int mid);

	/**
	 * 忘记密码
	 * 
	 * @param username
	 * @param password
	 * @param code
	 * @return
	 */
	Result<?> forgotPassword(String username, String password, String code);

	/**
	 * 注册
	 * 
	 * @param username
	 * @param password
	 * @param code
	 * @param regip
	 * @return
	 */
	Result<?> register(String openid, String username, String password, String code, String regip) throws WxErrorException;

	/**
	 * 验证微信登录
	 * 
	 * @param wxMessage
	 * @return
	 */
	WxMpXmlOutMessage wxMpVerifyBind(WxMpXmlMessage wxMessage);

	/**
	 * 微信签到
	 * 
	 * @param wxMessage
	 * @return
	 */
	WxMpXmlOutMessage wxMpClickSgin(WxMpXmlMessage wxMessage);
}
